package com.rsxy.service.controller;

import com.rsxy.service.pojo.RsImage;
import com.rsxy.service.service.RsImageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@Api(tags= "商品图片相关接口")
@RequestMapping(method = RequestMethod.POST,value = "/proImg")
public class ProImageController {
    @Autowired
    private RsImageService rsImageService;
    @RequestMapping("/getImageById")
    @ApiOperation(value = "根据商品id获取指定图片",notes = "测试数据")
    public List<RsImage> getImageById(@RequestBody String product_id){
        Map<String,Object> map=new HashMap<>();
        map.put("product_id",product_id);
        List<RsImage> rsImages = rsImageService.getBaseMapper().selectByMap(map);
        return rsImages;
    }
}
